package com.kwd.news.service.impl;

import com.kwd.news.dao.GlobalConfigDao;
import com.kwd.news.model.GlobalConfig;
import com.kwd.news.service.GlobalConfigService;
import com.meirengu.service.impl.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * GlobalConfig服务实现层
 *
 * @author Mao
 * @create Thu Mar 29 11:00:19 CST 2018
 */
@Service
public class GlobalConfigServiceImpl extends BaseServiceImpl<GlobalConfig> implements GlobalConfigService {

    @Autowired
    GlobalConfigDao globalConfigDao;

    @Override
    public GlobalConfig getGlobalConfig(Map map) throws Exception {
        return globalConfigDao.detailBy(map);
    }

    @Override
    public int addGlobalConfig(GlobalConfig globalConfig) throws Exception {
        return globalConfigDao.insert(globalConfig);
    }

    @Override
    public int updateGlobalConfig(GlobalConfig globalConfig) throws Exception {
        return globalConfigDao.update(globalConfig);
    }

    @Override
    public int deleteGlobalConfig(int id) throws Exception {
        return globalConfigDao.delete(id);
    }

}
